package io.packaging;

import java.io.*;

public class Text {
    public static void main(String[] args){

        try (   InputStream a = new FileInputStream("D:\\jave\\code\\hellow wrod.txt");
                //定义一个字节包装流来包装原始流的输入流
              InputStream S =new BufferedInputStream(a,8192*2);

                OutputStream a1 = new FileOutputStream("D:\\workspace\\basic-chapter\\src\\io\\packaging\\a.txt");
              OutputStream S1=new  BufferedOutputStream(a1);
              )
        {
            int s ;
            byte []buffer=new byte[1024];
            while((s=S.read(buffer))!=-1)
            {
                S1.write(buffer,0,s);
            }

        } catch (Exception e) {
            throw new RuntimeException(e);

        }


    }
    }

